namespace Jumpton.SFA.Server.Entity {
    using System;
    using System.Collections.Generic;
    using System.Text;
    using Jumpton.Persistent;
    using System.Data;
    using System.Runtime.Serialization;
    
    
    [System.SerializableAttribute()]
    [Map("Objective")]
    public class Objective : ObjectRow {
        
        public Objective() {
        }
        
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataRow">DataTable 中的一行数据</param>
        /// <param name="objectTable">存储当前对象的数据表格</param>
        public Objective(System.Data.DataRow dataRow, ObjectTable parent) : 
                base(dataRow, parent) {
        }
        
        /// <summary>
        /// 供反序列化使用的构造函数
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected Objective(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : 
                base(info, context) {
        }
        
        [Key("ID",true,true)]
        public decimal ID {
            get {
                return (System.Decimal)GetValue("ID");
            }
            set {
                SetValue("ID", value);
            }
        }
        
        [Field("Name")]
        public string Name {
            get {
                return (System.String)GetValue("Name");
            }
            set {
                SetValue("Name", value);
            }
        }
        
        [Field("Unit")]
        public string Unit {
            get {
                return (System.String)GetValue("Unit");
            }
            set {
                SetValue("Unit", value);
            }
        }

        [Field("INPUTTYPE")]
        public int INPUTTYPE {
            get {
                return (System.Int32)GetValue("INPUTTYPE");
            }
            set {
                SetValue("INPUTTYPE", value);
            }
        }

        [Field("OBJECTIVETYPE")]
        public int OBJECTIVETYPE
        {
            get
            {
                try
                {
                    return (System.Int32)GetValue("OBJECTIVETYPE");
                }
                catch { return -1; }
            }
            set
            {
                SetValue("OBJECTIVETYPE", value);
            }
        }

        [Field("Domain_ID")]
        public decimal DomainID {
            get {
                return (System.Decimal)GetValue("DomainID");
            }
            set {
                SetValue("DomainID", value);
            }
        }

        [Field("LAST_UPDATER")]
        public string LAST_UPDATER
        {
            get
            {
                return (System.String)GetValue("LAST_UPDATER");
            }
            set
            {
                SetValue("LAST_UPDATER", value);
            }
        }

        [Field("LAST_UPDATE_TIME")]
        public decimal LAST_UPDATE_TIME
        {
            get {
                return (System.Decimal)GetValue("LAST_UPDATE_TIME");
            }
            set {
                SetValue("LAST_UPDATE_TIME", value);
            }
        }

        [Field("ACTIVE")]
        public bool Active {
            get {
                return (System.Boolean)GetValue("ACTIVE");
            }
            set {
                SetValue("ACTIVE", value);
            }
        }

        [Field("CREATE_TIME")]
        public decimal CREATETIME
        {
            get {
                return (System.Decimal)GetValue("CREATETIME");
            }
            set {
                SetValue("CREATETIME", value);
            }
        }
    }
}
